/*
 * @(#)MediaCollection.java
 * 
 * Copyright(C) 2004 Yujin Kim
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */
package com.netexplode.jtunes.model.media;

import java.util.ArrayList;
import java.util.List;

/**
 * <code>MediaCollection</code> represents .....
 * 
 * @author ykim
 * @version $Revision: 1.3 $
 * @since 0.1
 */
public class MediaCollection {

    // private static final Log log = LogFactory.getLog(MediaCollection.class);

    protected String id;

    protected String name;

    protected List mediaFiles;

    protected int position;

    protected MediaCollection() {
        super();
        this.id = "" + this.hashCode();
        this.name = "";
        this.mediaFiles = new ArrayList();
    }

    /**
     * @return Returns the id.
     */
    public String getId() {
        return this.id;
    }

    /**
     * @param id
     *            The id to set.
     */
    public void setId(String id) {
        this.id = id;
    }

    /**
     * @return Returns the name.
     */
    public String getName() {
        return this.name;
    }

    /**
     * @param name
     *            The name to set.
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return Returns the mediaFiles.
     */
    public synchronized List getMediaFiles() {
        return this.mediaFiles;
    }

    /**
     * @param mediaFiles
     *            The mediaFiles to set.
     */
    public synchronized void setMediaFiles(List mediaFiles) {
        this.mediaFiles = mediaFiles;
    }

    /**
     * @return
     */
    public synchronized int size() {
        return this.mediaFiles.size();
    }

    /**
     * @param index
     * @return
     */
    public MediaFile getMediaFile(int index) {
        return (MediaFile) this.mediaFiles.get(index);
    }

    /**
     * @return Returns the position.
     */
    public synchronized int getPosition() {
        return position;
    }

    /**
     * @param position
     *            The position to set.
     */
    public synchronized void setPosition(int songIndex) {
        this.position = songIndex;
    }
}